package org.wmq.shopmanager.controller;

import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.wmq.commonutil.result.Result;
import org.wmq.shopmanager.service.ProductUnitService;
import org.wmq.shopmodel.Entity.product.ProductUnit;

import java.util.List;

@RestController
@RequestMapping("/admin/product/product-unit")
@RequiredArgsConstructor
public class ProductUnitController {
    private final ProductUnitService productUnitService;

    @GetMapping("list")
    public Result<List<ProductUnit>> getProductUnitList(){
        return Result.success(this.productUnitService.list());
    }
}
